home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gs_dps1.ps < prev    next >
Text File  |  1993-05-21  |  10KB  |  299 lines

  1. %    Copyright (C) 1990, 1991 Aladdin Enterprises.  All rights reserved.
  2. %
  3. % This file is part of Ghostscript.
  4. %
  5. % Ghostscript is distributed in the hope that it will be useful, but
  6. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. % to anyone for the consequences of using it or for whether it serves any
  8. % particular purpose or works at all, unless he says so in writing.  Refer
  9. % to the Ghostscript General Public License for full details.
  10. %
  11. % Everyone is granted permission to copy, modify and redistribute
  12. % Ghostscript, but only under the conditions described in the Ghostscript
  13. % General Public License.  A copy of this license is supposed to have been
  14. % given to you along with Ghostscript so you can know your rights and
  15. % responsibilities.  It should be in a file named COPYING.  Among other
  16. % things, the copyright notice and this notice must be preserved on all
  17. % copies.
  18.  
  19. % Initialization file for analogs of Display PostScript functions
  20. % that are also included in Level 2.
  21. % When this is run, systemdict is still writable,
  22. % but everything defined here goes into level2dict.
  23.  
  24. level2dict begin
  25.  
  26. % ------ Binary token support ------ %
  27.  
  28. % Initialization for the system name table.
  29.  
  30. mark
  31. % 0
  32.     /abs /add /aload /anchorsearch /and
  33.     /arc /arcn /arct /arcto /array
  34.     /ashow /astore /awidthshow /begin /bind
  35.     /bitshift /ceiling /charpath /clear /cleartomark
  36. % 20
  37.     /clip /clippath /closepath /concat /concatmatrix
  38.     /copy /count /counttomark /currentcmykcolor /currentdash
  39.     /currentdict /currentfile /currentfont /currentgray /currentgstate
  40.     /currenthsbcolor /currentlinecap /currentlinejoin /currentlinewidth /currentmatrix
  41. % 40
  42.     /currentpoint /currentrgbcolor /currentshared /curveto /cvi
  43.     /cvlit /cvn /cvr /cvrs /cvs
  44.     /cvx /def /defineusername /dict /div
  45.     /dtransform /dup /end /eoclip /eofill
  46. % 60
  47.     /eoviewclip /eq /exch /exec /exit
  48.     /file /fill /findfont /flattenpath /floor
  49.     /flush /flushfile /for /forall /eg
  50.     /get /getinterval /grestore /gsave /gstate
  51. % 80
  52.     /gt /identmatrix /idiv /idtransform /if
  53.     /ifelse /image /imagemask /index /ineofill
  54.     /infill /initviewclip /inueofill /inufill /invertmatrix
  55.     /itransform /known /le /length /lineto
  56. % 100
  57.     /load /loop /lt /makefont /matrix
  58.     /maxlength /mod /moveto /mul /ne
  59.     /neg /newpath /not /null /or
  60.     /pathbbox /pathfoall /pop /print /printobject
  61. % 120
  62.     /put /putinterval /rcurveto /read /readhexstring
  63.     /readline /readstring /rectclip /rectfill /rectstroke
  64.     /rectviewclip /repeat /restore /rlineto /rmoveto
  65.     /roll /rotate /round /save /scale
  66. % 140
  67.     /scalefont /search /selectfont /setbbox /setcachedevice
  68.     /setcachedevice2 /setcharwidth /setcmykcolor /setdash /setfont
  69.     /setgray /setgstate /sethsbcolor /setlinecap /setlinejoin
  70.     /setlinewidth /setmatrix /setrgbcolor /setshared /shareddict
  71. % 160
  72.     /show /showpage /stop /stopped /store
  73.     /string /stringwidth /stroke /strokepath /sub
  74.     /systemdict /token /transform /translate /truncate
  75.     /type /uappend /ucache /ueofill /ufill
  76. % 180
  77.     /undef /upath /userdict /ustroke /viewclip
  78.     /viewclippath /where /widthshow /write /writehexstring
  79.     /writeobject /writestring /wtranslation /xor /xshow
  80.     /xyshow /yshow /FontDirectory /SharedFontDirectory /Courier
  81. % 200
  82.     /Courier-Bold /Courier-BoldOblique /Courier-Oblique /Helvetica /Helvetica-Bold
  83.     /Helvetica-BoldOblique /Helvetica-Oblique /Symbol /Times-Bold /Times-BoldItalic
  84.     /Times-Italic /Times-Roman /execuserobject /currentcolor /currentcolorspace
  85.     /currentglobal /execform /filter /findresource /globaldict
  86. % 220
  87.     /makepattern /setcolor /setcolorspace /setglobal /setpagedevice
  88.     /setpattern
  89. % pad to 256
  90.     counttomark 256 exch sub { 0 } repeat
  91. % 256
  92.     /= /== /ISOLatin1Encoding /StandardEncoding
  93. % 260
  94.     /[ /] /atan /banddevice /bytesavailable
  95.     /cachestatus /closefile /colorimage /condition /copypage
  96.     /cos /countdictstack /countexecstack /cshow /currentblackgeneration
  97.     /currentcacheparams /currentcolorscreen /currentcolortransfer /currentcontext /currentflat
  98. % 280
  99.     /currenthalftone /currenthalftonephase /currentmiterlimit /currentobjectformat /currentpacking
  100.     /currentscreen /currentstrokeadjust /currenttransfer /currentundercolorremoval /defaultmatrix
  101.     /definefont /deletefile /detach /deviceinfo /dictstack
  102.     /echo /erasepage /errordict /execstack /executeonly
  103. % 300
  104.     /exp /false /filenameforall /fileposition /fork
  105.     /framedevice /grestoreall /handleerror /initclip /initgraphics
  106.     /initmatrix /instroke /inustroke /join /kshow
  107.     /ln /lock /log /mark /monitor
  108. % 320
  109.     /noaccess /notify /nulldevice /packedarray /quit
  110.     /rand /rcheck /readonly /realtime /renamefile
  111.     /renderbands /resetfile /reversepath /rootfont /rrand
  112.     /run /scheck /setblackgeneration /setcachelimit /setcacheparams
  113. % 340
  114.     /setcolorscreen /setcolortransfer /setfileposition /setflat /sethalftone
  115.     /sethalftonephase /setmiterlimit /setobjectformat /setpacking /setscreen
  116.     /setstrokeadjust /settransfer /setucacheparams /setundercolorremoval /sin
  117.     /sqrt /srand /stack /status /statusdict
  118. % 360
  119.     /true /ucachestatus /undefinefont /usertime /ustrokepath
  120.     /version /vmreclaim /vmstatus /wait /wcheck
  121.     /xcheck /yield /defineuserobject /undefineuserobject /UserObjects
  122.     /cleardictstack
  123. % 376
  124.     /A /B /C /D /E /F /G /H /I /J /K /L /M
  125.     /N /O /P /Q /R /S /T /U /V /W /X /Y /Z
  126.     /a /b /c /d /e /f /g /h /i /j /k /l /m
  127.     /n /o /p /q /r /s /t /u /v /w /x /y /z
  128. % 428
  129.     /setvmthreshold (<<) cvn
  130.     (>>) cvn /currentcolorrendering /currentdevparams /currentoverprint /currentpagedevice
  131.     /currentsystemparams /currentuserparams /defineresource /findencoding /gcheck
  132. % 440
  133.     /glyphshow /languagelevel /product /pstack /resourceforall
  134.     /resourcestatus /revision /serialnumber /setcolorrendering /setdevparams
  135.     /setoverprint /setsystemparams /setuserparams /startjob /undefineresource
  136.     /GlobalFontDirectory /ASCII85Decode /ASCII85Encode /ASCIIHexDecode /ASCIIHexEncode
  137. % 460
  138.     /CCITTFaxDecode /CCITTFaxEncode /DCTDecode /DCTEncode /LZWDecode
  139.     /LZWEncode /NullEncode /RunLengthDecode /RunLengthEncode /SubFileDecode
  140.     /CIEBasedA /CIEBasedABC /DeviceCMYK /DeviceGray /DeviceRGB
  141.     /Indexed /Pattern /Separation
  142. % 478 -- end
  143. counttomark packedarray exch pop
  144.  
  145. % Install the system and user name tables.
  146. % The user name table is read-only for ordinary programs,
  147. % since it doesn't obey save/restore and must be managed specially.
  148.  
  149. dup /SystemNames exch def
  150. 100 array readonly dup /UserNames exch def
  151. .installnames
  152.  
  153. % Define printobject and writeobject.
  154.  
  155. /printobject { .stdout 3 1 roll writeobject } odef
  156.  
  157. /.writeobjectbuf 1 array def
  158. /writeobject { exch .writeobjectbuf dup 0 4 -1 roll put .writeobjects } odef
  159.  
  160. % Implement binary error message output.
  161. errordict begin
  162.   /.printerror
  163.    { $error /binary get .languagelevel 2 eq and
  164.       { currentobjectformat 0 ne
  165.          { [ /Error $error /errorname get $error /command get false
  166.        ] 250 printobject
  167.      }
  168.      //.printerror
  169.     ifelse
  170.       }
  171.       //.printerror
  172.      ifelse
  173.    } bind def
  174. end
  175.  
  176. % ------ Fonts ------ %
  177.  
  178. /selectfont
  179.     { exch findfont exch
  180.       dup type /arraytype eq { makefont } { scalefont } ifelse
  181.       setfont
  182.     } odef
  183. /undefinefont
  184.     { FontDirectory exch undef
  185.     } odef
  186.  
  187. % ------ Halftones ------ %
  188.  
  189. /.currenthalftonetypes [
  190.     { exch pop } bind        % halftone
  191.     { /HalftoneType 1        % screen
  192.        { /Frequency /Angle /SpotFunction }
  193.       .makestackdict
  194.     }
  195.     { /HalftoneType 2        % colorscreen
  196.        { /RedFrequency /RedAngle /RedSpotFunction
  197.          /GreenFrequency /GreenAngle /GreenSpotFunction
  198.          /BlueFrequency /BlueAngle /BlueSpotFunction
  199.          /GrayFrequency /GrayAngle /GraySpotFunction
  200.        }
  201.       .makestackdict
  202.     }
  203. ] def
  204. /.makestackdict
  205.     { { counttomark -1 roll } forall .dicttomark
  206.     } bind def
  207. /currenthalftone
  208.     { mark .currenthalftone .currenthalftonetypes exch get exec
  209.     } odef
  210. /sethalftone
  211.     { dup /HalftoneType get 1 sub
  212.        { .sethalftone1 .sethalftone2 .sethalftone3 .sethalftone4
  213.          .sethalftone5
  214.        } exch get exec
  215.     } odef
  216. % Redefine setscreen to recognize halftone dictionaries.
  217. /..setscreen /setscreen load def
  218. /setscreen
  219.     { dup type /dicttype eq
  220.        { sethalftone pop pop }
  221.        { ..setscreen }
  222.       ifelse
  223.     } bind odef
  224. % Redefine currentscreen and currentcolorscreen similarly.
  225. /.currentscreentypes [
  226.     { 60 exch 0 exch } bind            % halftone
  227.     { }                    % screen
  228.     { 12 3 roll 9 { pop } repeat }        % colorscreen
  229. ] def
  230. /currentscreen
  231.     { .currenthalftone .currentscreentypes exch get exec
  232.     } odef
  233. /.currentcolorscreentypes [
  234.     { 60 exch 0 exch 3 copy 6 copy } bind    % halftone
  235.     { 3 copy 6 copy } bind            % screen
  236.     { }                    % colorscreen
  237. ] def
  238. /currentcolorscreen
  239.     { .currenthalftone .currentcolorscreentypes exch get exec
  240.     } odef
  241.  
  242. % ------ User objects ------ %
  243.  
  244. % **************** We have to disable .localarray
  245. % **************** because local/global VM isn't really implemented yet.
  246. /.localarray
  247.     { currentshared false setshared
  248.       exch array exch setshared
  249.     } bind def
  250. /.localarray /array load def    % ****************
  251. /defineuserobject
  252.     { userdict /UserObjects known
  253.        { 1 index userdict /UserObjects get length ge
  254.           { 1 index 1 add .localarray userdict /UserObjects get
  255.             1 index copy pop
  256.             userdict /UserObjects 3 -1 roll put
  257.           }
  258.          if
  259.        }
  260.        { userdict /UserObjects 3 index 1 add .localarray put
  261.        }
  262.       ifelse
  263.       userdict /UserObjects get 3 1 roll put
  264.     } odef
  265. /execuserobject
  266.     { userdict /UserObjects get exch get exec
  267.     } odef
  268. /undefineuserobject
  269.     { userdict /UserObjects get exch null put
  270.     } odef
  271.  
  272. % ------ User paths ------ %
  273.  
  274. /upath
  275.     { [ exch {/ucache cvx} if pathbbox /setbbox cvx
  276.       {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx}
  277.       pathforall ] cvx
  278.     } odef
  279.  
  280. % Dummy definitions for cache control operators
  281.  
  282. /ucachestatus
  283.     { mark 0 0 0 0 0 } odef
  284. /setucacheparams
  285.     { cleartomark } odef
  286.  
  287. % ------ Virtual memory ------ %
  288.  
  289. %**************** Everything here is a stub. ****************%
  290.  
  291. /setvmthreshold { pop } odef
  292. /shareddict currentdict /globaldict .knownget not { 20 dict } if def
  293. /SharedFontDirectory FontDirectory def
  294. /vmreclaim { pop } odef
  295.  
  296. % End of level2dict
  297.  
  298. end
  299.